package uk.ac.open.kmi.dyniqx.wrappers;

import org.apache.log4j.Logger;

import uk.ac.open.kmi.dyniqx.storages.Storage;
import uk.ac.open.kmi.dyniqx.repositories.PerXRepository;
import uk.ac.open.kmi.dyniqx.repositories.PubMedRepository;
import uk.ac.open.kmi.dyniqx.repositories.IntuteRepository;
import uk.ac.open.kmi.dyniqx.repositories.GoogleScholarRepository;
import uk.ac.open.kmi.dyniqx.repositories.GoogleImagesRepository;
import uk.ac.open.kmi.dyniqx.repositories.YahooImagesRepository;
import uk.ac.open.kmi.dyniqx.repositories.GoogleVideoRepository;

public class RepositoryWrapper {

	private Storage storage;
	private PubMedRepository repositoryPubMed;
	private IntuteRepository repositoryIntute;
	private GoogleScholarRepository repositoryGoogleScholar;
	private PerXRepository repositoryPerX;
	private GoogleImagesRepository repositoryGoogleImages;
	private YahooImagesRepository repositoryYahooImages;
	private GoogleVideoRepository repositoryGoogleVideo;
	
	public Logger logger = Logger.getLogger("uk.ac.open.kmi.dyniqx.wrappers.RepositoryWrapper");
	
	public RepositoryWrapper() {
		this.logger.debug("RepositoryWrapper instance created.");
	}
	
	public void searchRepositories(String queryString) {
		
		this.logger.info("Search all repositories for " + queryString + ".");
		
		this.repositoryPubMed.performQuery(queryString);
		this.repositoryIntute.performQuery(queryString);
		this.repositoryGoogleScholar.performQuery(queryString);
		// this.repositoryPerX.performQuery(queryString);
		
		this.repositoryGoogleImages.performQuery(queryString);
		this.repositoryYahooImages.performQuery(queryString);
		
		this.repositoryGoogleVideo.performQuery(queryString);
		
	}
	
	public void setStorage(Storage storage) {
		this.storage = storage;
	}	
	
	public Storage getStorage() {
		return this.storage;
	}
	
	public void setRepositoryPubMed(PubMedRepository repositoryPubMed) {
		this.repositoryPubMed = repositoryPubMed;
	}	
	
	public PubMedRepository getRepositoryPubMed() {
		return this.repositoryPubMed;
	}

	public GoogleScholarRepository getRepositoryGoogleScholar() {
		return repositoryGoogleScholar;
	}

	public void setRepositoryGoogleScholar(GoogleScholarRepository repositoryGoogleScholar) {
		this.repositoryGoogleScholar = repositoryGoogleScholar;
	}

	public IntuteRepository getRepositoryIntute() {
		return repositoryIntute;
	}

	public void setRepositoryIntute(IntuteRepository repositoryIntute) {
		this.repositoryIntute = repositoryIntute;
	}

	public PerXRepository getRepositoryPerX() {
		return repositoryPerX;
	}

	public void setRepositoryPerX(PerXRepository repositoryPerX) {
		this.repositoryPerX = repositoryPerX;
	}

	public GoogleImagesRepository getRepositoryGoogleImages() {
		return repositoryGoogleImages;
	}

	public void setRepositoryGoogleImages(GoogleImagesRepository repositoryGoogleImages) {
		this.repositoryGoogleImages = repositoryGoogleImages;
	}

	public YahooImagesRepository getRepositoryYahooImages() {
		return repositoryYahooImages;
	}

	public void setRepositoryYahooImages(YahooImagesRepository repositoryYahooImages) {
		this.repositoryYahooImages = repositoryYahooImages;
	}
	public GoogleVideoRepository getRepositoryGoogleVideo() {
		return repositoryGoogleVideo;
	}

	public void setRepositoryGoogleVideo(GoogleVideoRepository repositoryGoogleVideo) {
		this.repositoryGoogleVideo = repositoryGoogleVideo;
	}
}
